package hotel.meituan.oversea.biz.task;

import hotel.meituan.oversea.biz.service.MtHotelOrderDealSplitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;


@Slf4j
@Component
public class MeituanSplitMasterOrderCancelTask {
    private String timestamp = "Msmoct"+String.valueOf(System.currentTimeMillis());

    @Autowired
    private RestTemplate restTemplate;

//    @Autowired
//    private MtHotelOrderDealSplitService mtHotelOrderDealSplitService;

    //@Async 标识这个方法异步执行，可返回void或Future
    @Async
    public void executeSplitCancel(String master_mtDisOrderId_index,MtHotelOrderDealSplitService mtHotelOrderDealSplitService){
        log.info("MeituanSplitMasterOrderCancelTask 进入异步线程调用取消拆单");
        try {
            Thread.sleep(1000);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
        mtHotelOrderDealSplitService.cancelOtherChildSplitOrder(master_mtDisOrderId_index,null,"userApplyCancel");

    }


}
